<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>部门信息添加</title>
</head>
<body>
	<fieldset id="">
		<legend>信息添加</legend>
		<div class="layui-field-box">
			<form action="" class="layui-form layui-form-pane" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">项目代码</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="code" id="" class="layui-input"
							lay-verify="required" placeholder="请输入项目代码" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目名称</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="name" id="" class="layui-input"
							lay-verify="required" placeholder="请输入项目名称" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">项目起始时间</label>
					<div id="" class="layui-input-inline">
						<input type="text" name="time" id="time" class="layui-input"
							lay-verify="required" placeholder="请输入时间" />
					</div>
				</div>
				<div class="layui-form-item">
					<div id="" class="layui-input-inline">
						<input type="button" name="" id="" value="确定" class="layui-btn" lay-submit lay-filter="add" />
						<input type="button" name="" id="" value="取消" onclick="closeThis()" class="layui-btn " />
<!-- 						<input type="reset" name="" id="" value="重置" class="layui-btn layui-btn-primary" /> -->
					</div>

				</div>
				<input type="hidden" name="action" id="" value="add" />
			</form>
		</div>

	</fieldset>

	<script type="text/javascript">
	a();
	function a(){
		renderDate("time");
	}
	function renderDate(id){
		laydate.render({
			elem:"#"+id,
			type:"datetime",
			value:new Date()//在日期框中显示系统当前时间
			
		})
	}
		formSubmit("/ProjectServlet", "submit(add)", 'text', function(data) {
// 			console.log(data)
			if ("repeat" == data) {
				layer.msg("该项目已经存在")
			} else if (1 == data) {
				layer.msg("添加成功",closeThis)
			} else {
				layer.msg("添加失败")
			}
		})
		
	</script>
</body>
</html>